#pragma once

#include "QRWCreateCurveWidget.h"
#include "ui_CreateParabolaWidget.h"

class MainWindow;
class ShapeOperation;

QT_BEGIN_NAMESPACE
namespace Ui { class CreateParabolaWidgetClass; };
QT_END_NAMESPACE

class CreateParabolaWidget : public QRWCreateCurveWidget
{
	Q_OBJECT

public:
	CreateParabolaWidget(MainWindow* inMainWindow, ShapeOperation* inOperation = nullptr, QWidget* parent = nullptr);
	~CreateParabolaWidget();
protected:
	void onPosChanged();

	virtual void OnPickPosition(const gp_Pnt& inPosition) override;
	virtual class ShapeOperation* GetOperation() override;
	virtual void GenerateFeatureShapeForCacheActor() override;
	virtual bool eventFilter(QObject* obj, QEvent* event) override;
	virtual void OnPickDirection(const gp_Vec& inDirection) override;
	virtual void Reset() override;

	void UpdateInner();
private:
	std::pair<bool, gp_Ax2> GetCurrentAxis();
private:
	Ui::CreateParabolaWidgetClass *ui;

protected:

	RWTripleFloatInput* m_vertexPnt;
	RWTripleFloatInput* m_axisVec;
	RWTripleFloatInput* m_directrixVec;
};
